/*
 * ICommandBar.java
 *
 * Created on 28 October 2007, 21:40
 *
 */

package net.ubinow.mflex.baseui;

import net.ubinow.mflex.events.IEventPublisher;

/**
 * interface for the command bar
 * @author Josh
 */
public interface ICommandBar extends IWidget, IEventPublisher {
    
    static final int VIEWING_STATE_SHOW 		= 0;
    static final int VIEWING_STATE_DOCK		= 1;
    
    static final int CMD_NONE	= -1;
    static final int CMD_LEFT 	= 0;
    static final int CMD_RIGHT 	= 1;
    
    ///
    // positioning and padding (will be dependent on screen size of the phone)
    ///
    
    // command bar text on the command bar
    static final int CMD_TEXT_PADDING_X 		= 10; // text padding for the text that is displayed on the actual command bar
    static final int CMD_TEXT_PADDING_Y			= 8;
    static final int CMD_BUTTON_PADDING_Y		= 2; // padding from the top of the command bar to the button
    
    
    // panel positioning and padding
    static final int CMD_BAR_PANEL_PADDING_X		= 5; // padding the commands 'dialog' is from the edge oft he screen
    
    // cmds (command text) positioning and padding
    static final int CMD_PADDING_Y                       = 10; // padding between commands
    static final int CMD_PADDING_TOP                     = 10;
    static final int CMD_PADDING_X                       = 5;
    
    // padding for the 'highlight' gfx
    static final int CMD_HIGHLIGHT_PADDING_X		= 0;
    static final int CMD_SEL_GFX_PADDING_Y		= 50; // padding between the right edge of the 'selGfx' and the command panel
    static final int CMD_ICON_PADDING_X			= 10; // gap between the icon and commadn label
    
    // array indexers that access the _cmdIcon image depending if the cmd is selected or not
    static final int ARRIDX_UNSELECTED 	= 0;
    static final int ARRIDX_SELECTED	= 1;
    
    /** called when the command bar is to be shown **/
    public void show( int side );
    
    /** called when the command bar is to be docked **/
    public void dock();
    
    /** returns true if the command bar is fully showing (not in a transition state and not docked **/
    public boolean isShowing();
    
    /** returns true if the command bar is fully docked **/
    public boolean isDocked();
    
    /**
     * initialise the commands on the command bar
     * param leftCmdIDs: array of command ids associated with the left command button
     * param rightCmdIDs: array of command ids associated with the right command button
     **/
    public void initCommands( int[] leftCmdIDs, int[] rightCmdIDs );
    
    /**
     * initialises the commands for the specified side (determined by the side parameter)
     * param side:   left or right side to associate the commands with
     * param cmdIDs: array of command ids associated with the specified command button
     **/
    public void initCommands( int side, int[] cmdIDs );
    
    /** adds a commadn to the specified side **/
    public void addCommand( int side, int cmdID );
    
    /** inserts a command to the specified commadn side in the specified index **/
    public void insertCommand( int side, int cmdID, int index );
    
    /** removes a command from the specified side command bar **/
    public void removeCommand( int side, int cmdID );
    
    /** used to enable/disable the command bar - ie user wont be able to interact with the softkeys via the commandbar **/ 
    public void enabled( boolean enable );
    
    public boolean isEnabled();
    
}
